with open('a.txt', 'a', encoding='utf-8') as f:
 f.write('good good study ')
# a ⽅式打开⽂件, ⽂件不存在会创建⽂件, ⽂件存在, 在⽂件的末尾写⼊内容